﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace GtsServer.Manage.IISPage.Ajax
{
    /// <summary>
    /// CommonAjax 的摘要说明
    /// </summary>
    public class CommonAjax : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            string type = string.Empty;
            if (context.Request["action"] != null)
            {
                type = context.Request["action"];

                switch (type)
                {
                    case "UploadFunc":
                        UpLoadContent(context);
                        break;
                    default:
                        break;
                }
            }
        }
        IISDalHelper helper = new IISDalHelper();
        private void UpLoadContent(HttpContext context)
        {
            string fileName = string.Empty;
            bool isSuccess = helper.SaveContent(context.Request.Files[0], out fileName);
            context.Response.Write(isSuccess + "|" + fileName);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}